<div id="instructions" class="paper">
{{theme:image file='paperclip-icon.png' class="clipp"}}
<h3 class="title2">{{title}}</h3>
<div id="register">
<?php 
$attributes = array('class' => 'form_inputs ', 'id' => '');
echo form_open_multipart('',$attributes)?>

<div class="">
	<table class="table" style="width:100%">
<tbody>
	<tr>
			<td><?php echo lang('users:full_name')?></td>
			<td colspan="3">
				{{if is_admin}}
				<?php 
				$data = array('name'=>'display_name','id'=>'display_name','value'=> $model['display_name'],'maxlength'=>30,'class'=>'txt large');
				echo form_input($data); ?>
				{{else}}
					<strong>{{ model:display_name }}</strong>
				{{endif}}
			</td>
		</tr>
	<tr>
		<td width="150"><?php echo lang('users:username')?></td>
		<td colspan="3">
			<?php 
			$data = array('id'=>'username','value'=> $model['username'],'maxlength'=>20,'class'=>'txt large','readonly'=>'');
			echo form_input($data); ?>
		</td>
    </tr>  
	<tr>
		<td><?php echo lang('users:password')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'password','id'=>'password','value'=> $model['password'],'maxlength'=>20,'class'=>'txt large','placeholder ' => lang('users:password'));
			echo form_password($data)?>
		</td>
	</tr>
	<tr>
		<td>Email</td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'email','id'=>'email','value'=> $model['email'],'maxlength'=>60,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
    </tr>	
	<tr>
		<td><?php echo lang('users:birth')?></td>
		<td class="birth-s">
			<?php 
			$data = array('name'=>'birth','id'=>'birth','value'=> '{{helper:date format ="d-m-Y" timestamp = "'.$model['birth'].'" }}' ,'maxlength'=>10,'class'=>'txt fl');
			echo form_input($data); ?>
		</td>
			<td class="tr"><?php echo lang('users:sex')?></td>
			<td>
				<?php 
				echo form_dropdown('sex',array(''=>'---'.lang('users:sex').'---') +  $sex_select,$model['sex'],'class="fr medium"'); ?>
			</td>
		</tr>
	<tr>
		<td><?php echo lang('users:space')?></td>
		<td colspan="3">			
			<?php 
				$data = array('name'=>'space','id'=>'space','value'=> $model['space'],'maxlength'=>50,'class'=>'txt large');
				echo form_input($data); ?>
		</td>
    </tr>
	{{if is_admin}}
	<tr>	
		<td><?php echo lang('users:address')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'address','id'=>'address','value'=> $model['address'],'maxlength'=>100,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
	</tr>
	{{endif}}
	<tr>
		<td><?php echo lang('users:address2')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'address2','id'=>'address2','value'=> $model['address2'],'maxlength'=>100,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
		</tr>
		
		
		<tr>
			<td><?php echo lang('users:people')?></td>
			<td>
				<?php 
			$data = array('name'=>'people','id'=>'people','value'=> $model['people'],'maxlength'=>20,'class'=>'txt large');
			echo form_input($data); ?>
			</td>
			{{if is_admin}}
			<td class="tr"><?php echo lang('users:id_number')?></td>
			<td>
				
				<?php 
				$data = array('name'=>'id_number','id'=>'id_number','value'=> $model['id_number'],'maxlength'=>12,'class'=>'txt medium fr');
				echo form_input($data); ?>
				
			</td>
			{{else}}
			<td colspan="2"></td>
			{{endif}}
		</tr>
		{{if is_admin}}
		<tr>
			<td><?php echo lang('users:id_number_date')?></td>
			<td>
				<?php 
			$data = array('name'=>'id_number_date','id'=>'id_number_date','value'=> $model['id_number_date'],'maxlength'=>12,'class'=>'txt large');
			echo form_input($data); ?>
			</td>
			<td class="tr"><?php echo lang('users:id_number_space')?></td>
			<td>
				<?php 
			$data = array('name'=>'id_number_space','id'=>'id_number_space','value'=> $model['id_number_space'],'maxlength'=>30,'class'=>'txt fr medium');
			echo form_input($data); ?>
			</td>
		</tr>
		{{endif}}
		<tr>
			<td><?php echo lang('users:phone')?></td>
			<td colspan="3">
				<?php 
				$data = array('name'=>'phone','id'=>'phone','value'=> $model['phone'],'maxlength'=>15,'class'=>'txt large');
				echo form_input($data); ?>
			</td>
		</tr>
		<tr>
			<td><?php echo lang('users:marry')?></td>
			<td>
				<?php 
				echo form_dropdown('marry',array(''=>'---'.lang('users:marry').'---') +  $marry_select,$model['marry'],'class="fl medium"'); ?>
			</td>
			{{if is_admin}}
			<td class="tr"><?php echo lang('users:literacy')?></td>
			<td>
				<?php 
				echo form_dropdown('literacy',array(''=>'---'.lang('users:literacy').'---') + $literacy_select,$model['literacy'],'class="fr medium"'); ?>
			</td>
			{{else}}
			<td colspan="2"></td>
			{{endif}}
		</tr>
		
		<tr>
			<td><?php echo lang('users:specialize')?></td>
			<td colspan="3">
				<?php 
				$data = array('name'=>'specialize','id'=>'specialize','value'=> $model['specialize'],'maxlength'=>50,'class'=>'txt large');
				echo form_input($data); ?>
			</td>
		</tr>
		<tr>
			<td><?php echo lang('users:certificate')?></td>
			<td colspan="3">
				<?php 
				$data = array('name'=>'certificate','id'=>'certificate','value'=> $model['certificate'],'maxlength'=>100,'class'=>'txt large');
				echo form_input($data); ?>				
			</td>
		</tr>
		<tr>
		<td><?php echo lang('users:bank_id')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'bank_id','id'=>'bank_id','value'=> $model['bank_id'],'maxlength'=>15,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
		</tr>
        {{if is_admin}}
		<tr>
			<td><?php echo lang('users:id2')?></td>
			<td>
				<?php 
				$data = array('name'=>'id2','id'=>'id2','value'=> $model['id2'],'maxlength'=>5,'class'=>'txt fl medium');
				echo form_input($data); ?>
			</td>
			<td><?php echo lang('users:date_start')?></td>
			<td class="birth-s">
				<?php 
				$data = array('name'=>'date_start','id'=>'date_start','value'=> '{{helper:date format ="d-m-Y" timestamp = "'.$model['date_start'].'" }}' ,'maxlength'=>10,'class'=>'txt fl fr');
				echo form_input($data); ?>
			</td>
			</tr>
		<tr>
		{{endif}}
		{{if is_admin}}
		<tr>
		<td><?php echo lang('users:location')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'location','id'=>'location','value'=> $model['location'],'maxlength'=>50,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
		<tr>
		<td><?php echo lang('users:bhxh')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'bhxh','id'=>'bhxh','value'=> $model['bhxh'],'maxlength'=>10,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
		</tr>
		<tr>
		<td><?php echo lang('users:mst')?></td>
		<td colspan="3">
			<?php 
			$data = array('name'=>'mst','id'=>'mst','value'=> $model['mst'],'maxlength'=>12,'class'=>'txt large');
			echo form_input($data); ?>
		</td>
		</tr>
		<tr>
			<td><?php echo lang('users:allows_1')?></td>
			<td>
				<?php 
				$data = array('name'=>'allows_1','id'=>'allows_1','value'=> $model['allows_1'],'maxlength'=>3,'class'=>'txt fl medium');
				echo form_input($data); ?>
			</td>
			<td><?php echo lang('users:allows_2')?></td>
			<td>
				<?php 
				$data = array('name'=>'allows_2','id'=>'allows_2','value'=> $model['allows_2'] ,'maxlength'=>3,'class'=>'txt fr');
				echo form_input($data); ?>
			</td>
			</tr>
		<tr>
			<td><?php echo lang('users:limit_hd')?></td>
			<td>
				<?php 
				$data = array('name'=>'limit_hd','id'=>'limit_hd','value'=> $model['limit_hd'],'maxlength'=>20,'class'=>'txt fl medium');
				echo form_input($data); ?>
			</td>
			<td></td>
			<td>
			</td>
		</tr>
		{{endif}}
</tbody>
</table>
</div>

<div class="clr">
<button class="btn" name="btnAction" value="update">{{helper:lang line='global:save'}}</button>
</div>
<div class="clr15"></div>
<?php echo validation_errors('<p class="error">', '</p>'); ?>
<?php echo form_close()?>
</div>
<div class="shadow"></div>

<script>
$month_lang = '<?php echo lang('users:month') ?> ';
var mo = [];
for($i = 1;$i<13 ; $i++)
	mo.push($month_lang+$i);
var monthNamesShort = mo;
var dayNamesMin = [ '', '','','','','',''];
$("#birth").datepicker({
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
			showOn: "button",
			buttonImage: "{{ url:site uri= theme:path}}/img/_icon/btn_calenda.jpg",
			buttonImageOnly: true,
			yearRange: '<?php echo date("Y") - 60 ?>:<?php echo date("Y")-10 ?>',
			monthNamesShort : monthNamesShort,
			
			dayNamesMin: dayNamesMin,
			
			dateFormat: "dd-mm-yy",
			nextText: "Sau",
			prevText: "Trước",
});
$("#date_start").datepicker({
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
			showOn: "button",
			buttonImage: "{{ url:site uri= theme:path}}/img/_icon/btn_calenda.jpg",
			buttonImageOnly: true,
			yearRange: '<?php echo date("Y") - 60 ?>:<?php echo date("Y") ?>',
			monthNamesShort : monthNamesShort,
			
			dayNamesMin: dayNamesMin,
			
			dateFormat: "dd-mm-yy",
			nextText: "Sau",
			prevText: "Trước",
});


{{ if sussess}}
var r=confirm("{{helper:lang line='users:success_step2'}} {{room:title}} {{helper:lang line='users:ques_step2'}}");
if(r==true)
	$('.form_inputs input[type="text"]').val('');
else
	location.href = "users/login";
{{ endif }}
</script>


</div>